#!/usr/bin/env bash

vendorFolder=/code/php/php-proxy/vendor
vendorZipFile="vendor.tar.gz"
server=lujie@192.168.78.12
ssh $server \
"cd $vendorFolder && rm -f $vendorZipFile && tar -czf $vendorZipFile *"

cd ./vendor || exit
rm -rf ./*
scp "$server:$vendorFolder/$vendorZipFile" .
tar -xzf "$vendorZipFile"
rm "$vendorZipFile"
